Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add triggerable exit flow #38

Closed
wants to merge 28 commits into from
Closed

feat: add triggerable exit flow #38

wants to merge 28 commits into from

Conversation

loga4
Copy link
Contributor

@loga4 loga4 commented Feb 26, 2024

No description provided.

Copy link
Contributor

@TheDZhon TheDZhon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👀

contracts/0.8.9/TriggerableExit.sol Outdated Show resolved Hide resolved
contracts/forge-std/Base.sol Outdated Show resolved Hide resolved
@lidofinance lidofinance deleted a comment from github-actions bot Mar 27, 2024
Copy link
Contributor

@TheDZhon TheDZhon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for the significant progress here 👍

Looked briefly this time 👀 Will get back a bit later

contracts/0.8.9/TriggerableExitMock.sol Show resolved Hide resolved
contracts/0.8.9/WithdrawalVault.sol Outdated Show resolved Hide resolved
contracts/0.8.9/WithdrawalVault.sol Outdated Show resolved Hide resolved
contracts/0.8.9/WithdrawalVault.sol Outdated Show resolved Hide resolved
contracts/0.8.9/WithdrawalVault.sol Outdated Show resolved Hide resolved
receive() external payable {}

function forcedExit(bytes[] calldata pubkeys, address sender) external payable {
if (msg.sender != address(getLocator().validatorsExitBusOracle())) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

so we don't allow this method to be called by the DAO directly?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, DAO should send the report hash first for 2 reasons:

  1. exit more than 600 per/report
  2. depends on the exitFee - can reverts early

contracts/0.8.9/WithdrawalVault.sol Outdated Show resolved Hide resolved
contracts/0.8.9/WithdrawalVault.sol Outdated Show resolved Hide resolved
foundry.toml Outdated Show resolved Hide resolved
foundry.toml Outdated Show resolved Hide resolved
Copy link
Contributor

@TheDZhon TheDZhon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The second pass has been done 👀

contracts/0.8.9/WithdrawalVault.sol Outdated Show resolved Hide resolved
contracts/0.8.9/WithdrawalVault.sol Outdated Show resolved Hide resolved
contracts/0.8.9/WithdrawalVault.sol Outdated Show resolved Hide resolved
contracts/0.8.9/WithdrawalVault.sol Outdated Show resolved Hide resolved
uint256 vaultBalance = address(this).balance - msg.value;
uint256 fee = msg.value;

uint256 keysCount = pubkeys.length;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should check if non zero and isn't too large both

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we check it in VEBO contract here

contracts/0.8.9/oracle/ValidatorsExitBusOracle.sol Outdated Show resolved Hide resolved
contracts/0.8.9/oracle/ValidatorsExitBusOracle.sol Outdated Show resolved Hide resolved
contracts/0.8.9/oracle/ValidatorsExitBusOracle.sol Outdated Show resolved Hide resolved
contracts/0.8.9/oracle/ValidatorsExitBusOracle.sol Outdated Show resolved Hide resolved
_saveReportData(reportHash, requestsCount);
}

function forcedExitPubkeys(bytes[] calldata keys, ReportData calldata data) external payable {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no auth?

Copy link
Contributor Author

@loga4 loga4 Apr 10, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes - its a permissionless part

contracts/0.8.9/WithdrawalVault.sol Dismissed Show dismissed Hide dismissed
contracts/0.8.9/TriggerableExitMock.sol Dismissed Show dismissed Hide dismissed
contracts/0.8.9/TriggerableExitMock.sol Dismissed Show dismissed Hide dismissed
Copy link

github-actions bot commented Apr 24, 2024

badge

Code Coverage Summary

Filename                                                       Stmts    Miss  Cover    Missing
-----------------------------------------------------------  -------  ------  -------  ---------------------------------------------------------------------------------------------------------------------------------------------------------------------
contracts/0.4.24/Lido.sol                                        212       0  100.00%
contracts/0.4.24/StETH.sol                                        72       0  100.00%
contracts/0.4.24/StETHPermit.sol                                  15       0  100.00%
contracts/0.4.24/lib/Packed64x4.sol                                5       0  100.00%
contracts/0.4.24/lib/SigningKeys.sol                              36       0  100.00%
contracts/0.4.24/lib/StakeLimitUtils.sol                          37       0  100.00%
contracts/0.4.24/nos/NodeOperatorsRegistry.sol                   487     387  20.53%   208-280, 312-379, 403, 417-654, 669, 676-772, 790-793, 820-990, 1019, 1054-1131, 1179-1229, 1238-1239, 1248-1256, 1279-1339, 1348-1354, 1393, 1405-1409, 1421-1431
contracts/0.4.24/oracle/LegacyOracle.sol                          72      72  0.00%    114-399
contracts/0.4.24/utils/Pausable.sol                                9       0  100.00%
contracts/0.4.24/utils/Versioned.sol                               5       0  100.00%
contracts/0.6.12/WstETH.sol                                       17       0  100.00%
contracts/0.8.4/WithdrawalsManagerProxy.sol                       61      61  0.00%    26-518
contracts/0.8.9/BeaconChainDepositor.sol                          21       2  90.48%   48, 51
contracts/0.8.9/Burner.sol                                        71       0  100.00%
contracts/0.8.9/DepositSecurityModule.sol                        104       0  100.00%
contracts/0.8.9/EIP712StETH.sol                                   16       0  100.00%
contracts/0.8.9/LidoExecutionLayerRewardsVault.sol                16       0  100.00%
contracts/0.8.9/LidoLocator.sol                                   18       0  100.00%
contracts/0.8.9/OracleDaemonConfig.sol                            28       0  100.00%
contracts/0.8.9/StakingRouter.sol                                303       4  98.68%   311, 578, 1160-1161
contracts/0.8.9/TriggerableExitMock.sol                           72       1  98.61%   134
contracts/0.8.9/WithdrawalQueue.sol                               88       0  100.00%
contracts/0.8.9/WithdrawalQueueBase.sol                          146       0  100.00%
contracts/0.8.9/WithdrawalQueueERC721.sol                         89       0  100.00%
contracts/0.8.9/WithdrawalVault.sol                               44       5  88.64%   96-97, 163, 169, 173
contracts/0.8.9/exits/Prover.sol                                  12       1  91.67%   47
contracts/0.8.9/lib/Math.sol                                       4       0  100.00%
contracts/0.8.9/lib/PositiveTokenRebaseLimiter.sol                22       0  100.00%
contracts/0.8.9/lib/UnstructuredRefStorage.sol                     2       0  100.00%
contracts/0.8.9/oracle/AccountingOracle.sol                      171     171  0.00%    153-881
contracts/0.8.9/oracle/BaseOracle.sol                             89       0  100.00%
contracts/0.8.9/oracle/HashConsensus.sol                         263     132  49.81%   293-294, 330, 341-438, 452-483, 516-592, 626, 640, 675, 689, 718, 732, 755-852, 870, 884, 889-894, 912, 916-923, 948, 970-972, 978, 1005, 1010, 1017, 1054-1073, 1090
contracts/0.8.9/oracle/ValidatorsExitBusOracle.sol               114      36  68.42%   143-152, 244-316, 330, 341, 347, 351, 358, 371, 413, 421, 435, 493, 514
contracts/0.8.9/proxy/OssifiableProxy.sol                         17      16  5.88%    29-87
contracts/0.8.9/sanity_checks/OracleReportSanityChecker.sol      171       0  100.00%
contracts/0.8.9/utils/PausableUntil.sol                           31       0  100.00%
contracts/0.8.9/utils/Versioned.sol                               11       0  100.00%
contracts/0.8.9/utils/access/AccessControl.sol                    23       0  100.00%
contracts/0.8.9/utils/access/AccessControlEnumerable.sol           9       0  100.00%
TOTAL                                                           2983     888  70.23%

Diff against master

Filename                                              Stmts    Miss  Cover
--------------------------------------------------  -------  ------  -------
contracts/0.4.24/nos/NodeOperatorsRegistry.sol           +2     -98  +20.53%
contracts/0.8.9/TriggerableExitMock.sol                 +72      +1  +98.61%
contracts/0.8.9/WithdrawalVault.sol                     +23      +5  -11.36%
contracts/0.8.9/exits/Prover.sol                        +12      +1  +91.67%
contracts/0.8.9/oracle/BaseOracle.sol                     0      -1  +1.12%
contracts/0.8.9/oracle/HashConsensus.sol                  0    -131  +49.81%
contracts/0.8.9/oracle/ValidatorsExitBusOracle.sol      +23     -55  +68.42%
TOTAL                                                  +132    -278  +11.13%

Results for commit: 8a77a87

Minimum allowed coverage is 0%

♻️ This comment has been updated with latest results

@tamtamchik tamtamchik added contracts Pull requests that add add or update contracts. tests Pull requests that add or update tests. solidity Pull requests that update Solidity code. labels May 22, 2024
@tamtamchik
Copy link
Member

Closed as ported to lidofinance/lido-dao#859

@tamtamchik tamtamchik closed this Oct 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
contracts Pull requests that add add or update contracts. solidity Pull requests that update Solidity code. tests Pull requests that add or update tests.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants